package com.camel.core.model;

import lombok.Data;
import org.apache.commons.lang.StringUtils;

import java.util.List;

/**
 * 推送话单单个对象
 */
@Data
public class Cdrinfo {

    // 座席通话时长
    private String agent_duration;

    // 自动外呼任务名称
    private String taskname;

    // AI流程名称
    private String rwName;

    // 挂机原因
    private String custHangup;

    // 被叫号
    private String callee_num;

    // 主叫号
    private String caller_num;

    // AI助手记录
    private List<String> aiAssistantList;

    // 数组格式，记录一通呼叫的多个leg情况
    private List<String> legs;

    // 电话唯一标识
    private String call_uuid;

    // 一通电话有多个uuid，以逗号相隔，agent_uuid属于其中之一
    private String uuids;

    // 呼叫标识，1:呼入 2:手动呼出 3:自动呼出 4:内线 5:环回测试
    private String call_type;

    // 被叫员工工号
    private String callee_agent_num;

    // 主叫员工工号
    private String caller_agent_num;

    // 自动外呼任务ID
    private String taskid;

    // 录音文件
    private String recordFile;

    // 语音留言文件地址
    private String leaveVoiceAddr;

    // 业务携带标识（c+企业id+ _ +cusData，比如“c1_cusData”）
    private String cusData;

    // 开始时间
    private String start_time;

    // 未接通原因
    private String warnToneName;

    // 满意度
    private String grade;

    // 被叫部门名
    private String callee_agent_group_name;

    // 企业编号
    private String company_no;

    // 客户通话时长
    private String call_lasts_time;

    // 主叫部门名
    private String caller_agent_group_name;

    // CTI服务器地址
    private String ctiServer;

    // 是否是无效录音
    public boolean isNotValidData() {
        return StringUtils.isBlank(this.call_lasts_time) || StringUtils.isBlank(this.recordFile) || StringUtils.equals("0", this.call_lasts_time);
    }

    @Override
    public String toString() {
        return "Cdrinfo{" +
                "agent_duration='" + agent_duration + '\'' +
                ", taskname='" + taskname + '\'' +
                ", rwName='" + rwName + '\'' +
                ", custHangup='" + custHangup + '\'' +
                ", callee_num='" + callee_num + '\'' +
                ", caller_num='" + caller_num + '\'' +
                ", aiAssistantList=" + aiAssistantList +
                ", legs=" + legs +
                ", call_uuid='" + call_uuid + '\'' +
                ", uuids='" + uuids + '\'' +
                ", call_type='" + call_type + '\'' +
                ", callee_agent_num='" + callee_agent_num + '\'' +
                ", caller_agent_num='" + caller_agent_num + '\'' +
                ", taskid='" + taskid + '\'' +
                ", recordFile='" + recordFile + '\'' +
                ", leaveVoiceAddr='" + leaveVoiceAddr + '\'' +
                ", cusData='" + cusData + '\'' +
                ", start_time='" + start_time + '\'' +
                ", warnToneName='" + warnToneName + '\'' +
                ", grade='" + grade + '\'' +
                ", callee_agent_group_name='" + callee_agent_group_name + '\'' +
                ", company_no='" + company_no + '\'' +
                ", call_lasts_time='" + call_lasts_time + '\'' +
                ", caller_agent_group_name='" + caller_agent_group_name + '\'' +
                ", ctiServer='" + ctiServer + '\'' +
                '}';
    }
}
